<?php
JLoader::register("PCalendarModellistview", OC::$SERVERROOT."/apps/calendar/lib/listview.php");
JLoader::register("PJobpositionModelPositions", OC::$SERVERROOT."/apps/jobposition/lib/positions.php");

$LoginStats = PUtil::checkUserLogin(true);
if ($LoginStats !== true) {
   echo $LoginStats;
   exit();
}

OCP\JSON::callCheck();
$subuser = PCompanyHelper::getSubUser();
$model = new PJobpositionModelPositions();
list($jobslist, $pagination) = $model->getJobsList();
$tmpl = new OCP\Template('jobposition', 'part.jobs.list', '');
$tmpl->assign('jobslist', $jobslist);
$tmpl->assign('pagination', $pagination);
if (!PFactory::isMasterUser() && !($subuser->permissions & PERMISSION_JOB_CRUD && $subuser->permissions & PERMISSION_JOB_ADMIN_ALL)){
   echo '<div style="width:53%; margin-top:-179px; min-height:310px;" class="pull-left" id="joblist">';
}
else {
   echo '<div style="width:53%;" class="pull-left" id="joblist">';
}
$tmpl->printPage();
echo '</div>'; 


$model = new PCalendarModellistview();
list($interviewlist, $intevpagination) = $model->getTodayEventlist();
$tmpl = new OCP\Template('calendar', 'part.interviews.list', '');
$tmpl->assign('interviewlist', $interviewlist);
$tmpl->assign('intevpagination', $intevpagination);
echo '<div style="width:46%;" class="pull-right" id="interviewlist">'; 
$tmpl->printPage();
echo '</div>'; 
